toolchain/musl: fix build regression on x86_64
authorFelix Fietkau <[email protected]>
Tue, 6 May 2025 12:28:51 +0000 (14:28 +0200)
committerFelix Fietkau <[email protected]>
Tue, 6 May 2025 12:29:09 +0000 (14:29 +0200)
Fix whitespace mangling which broke matching opcodes in the CFI patch

Signed-off-by: Felix Fietkau <[email protected]>
toolchain/musl/patches/100-tools-Rework-adding-of-CFI-annotations.patch

index de45743caf564305450ab8b09973d8ed861b109e..833eb659dda593fbf19782e1e235316bd07a1b18 100644 (file)
@@ -1173,7 +1173,7 @@ Signed-off-by: Ignacy GawÄ\99dzki <[email protected]>
    if (in_function)
 --- a/tools/add-cfi.x86_64.awk
 +++ b/tools/add-cfi.x86_64.awk
-@@ -1,169 +1,246 @@
+@@ -1,169 +1,247 @@
 -# Insert GAS CFI directives ("control frame information") into x86-64 asm input
 +# Insert GAS CFI directives ("control frame information") into x86-64 asm input.
  
@@ -1291,7 +1291,9 @@ Signed-off-by: Ignacy GawÄ\99dzki <[email protected]>
 +  # Canonicalize whitespace.
 +  gsub(/[ \t]+/, " ") # Mawk doesn't understand \s.
    gsub(/ *, */, ",")
-   gsub(/ *: */, ": ")
+-  gsub(/ *: */, ": ")
++  if (match(":", $1))
++    sub(/ *: */, ": ")
    gsub(/ $/, "")
    gsub(/^ /, "")
  }
@@ -1507,7 +1509,7 @@ Signed-off-by: Ignacy GawÄ\99dzki <[email protected]>
      }
    }
  }
-@@ -171,24 +248,41 @@ function adjust_sp_offset(delta) {
+@@ -171,24 +249,41 @@ function adjust_sp_offset(delta) {
  # IF REGISTER VALUES ARE UNCEREMONIOUSLY TRASHED
  # ...then we want to know about it.
  #